<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/24/024
 * Time: 11:43
 */

namespace App\Validator;


class Match extends BaseValidate
{
    protected $rules = [
        'id'=>'required|integer',
        'league_id'=>'required|integer',
        'session'=>'required|size:8',
        'number'=>'required|string|size:3',
        'host'=>'required|between:2,30',
        'guest'=>'required|between:2,30',
        'balls'=>'required|integer|between:-5,5',
        'sp11'=>'required|numeric|min:1',
        'sp12'=>'required|numeric|min:1',
        'sp13'=>'required|numeric|min:1',
        'sp21'=>'required|numeric|min:1',
        'sp22'=>'required|numeric|min:1',
        'sp23'=>'required|numeric|min:1',
        'status'=>'required|integer|in:-1,0,1,2',
        'die_time'=>'required'
    ];
    protected $messages = [
        'id.required'=>'id参数缺失',
        'id.integer'=>'id参数格式错误',
        'league_id.required'=>'联赛参数缺失',
        'league_id.integer'=>'联赛参数格式错误',
        'session.required'=>'期数参数缺失',
        'session.size'=>'期数参数不合法',
        'number.required'=>'序号参数缺失',
        'number.string'=>'序号参数不合法',
        'number.size'=>'序号参数长度不合法',
        'host.required'=>'主队参数缺失',
        'host.between'=>'主队参数长度不合法',
        'guest.required'=>'客队参数缺失',
        'guest.between'=>'客队参数长度不合法',
        'balls.required'=>'让球参数缺失',
        'balls.integer'=>'让球参数不合法',
        'balls.between'=>'让球参数数值不合法',
        'sp11.required'=>'胜sp参数缺失',
        'sp11.numeric'=>'胜sp参数不合法',
        'sp11.min'=>'胜sp最小为1',
        'sp12.required'=>'平sp参数缺失',
        'sp12.numeric'=>'平sp参数不合法',
        'sp12.min'=>'平sp最小为1',
        'sp13.required'=>'负sp参数缺失',
        'sp13.numeric'=>'负sp参数不合法',
        'sp13.min'=>'负sp最小为1',
        'sp21.required'=>'让胜sp参数缺失',
        'sp21.numeric'=>'让胜sp参数不合法',
        'sp21.min'=>'让胜sp最小为1',
        'sp22.required'=>'让平sp参数缺失',
        'sp22.numeric'=>'让平sp参数不合法',
        'sp22.min'=>'让平sp最小为1',
        'sp23.required'=>'让负sp参数缺失',
        'sp23.numeric'=>'让负sp参数不合法',
        'sp23.min'=>'让负sp最小为1',

        'die_time.required'=>'截止时间参数缺失',
        'status.required'=>'状态参数缺失',
        'status.integer'=>'状态参数格式错误',
        'status.in'=>'状态参数值错误',

    ];
    protected $scenes = [
        'add'=>['league_id','session','number','host','guest','balls','sp11','sp12','sp13','sp21','sp22','sp23','status','die_time'],
        'edit'=>['id','league_id','session','number','host','guest','balls','sp11','sp12','sp13','sp21','sp22','sp23','die_time'],
    ];
}